package com.Fh.enum_;
public class enumeration01 {
    public static void main(String[] args) {
        Enum01 spring = new Enum01("春天","温暖");
        Enum01 summer = new Enum01("夏天","炎热");
        Enum01 autumn = new Enum01("秋天","凉爽");
        Enum01 winter = new Enum01("冬天","寒冷");
        //对于你所创建的对象没有约束，你可以继续往下创建
        Enum01 AAA = new Enum01("热天","难受");
        //没有一个限制，这时引入一个技术，通过枚举就可以实现这个约束-->见enumeration02
        //同时这里也可以修改通过set相关的方法可以修改信息
        spring.setName("Spring");
        spring.setDescription("安详");
        System.out.println(spring);
        System.out.println(summer);
        System.out.println(autumn);
        System.out.println(winter);
        //通过toString方法，避免返回默认值[全类名(包名+类名）+@+哈希值的十六进制
    }
}
//现在引出枚举
class Enum01 {
    String name;
    String description;
    //列举4个季节来引出
    public Enum01(String name, String description) {
        this.name = name;
        this.description = description;
    }
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Enum01{" +
                "description='" + description + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}